package casa.depesos.app.com.dlg;

import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import casa.depesos.app.com.R;
import casa.depesos.app.com.databinding.LoadingDlgBinding;


public class LoadingDlg extends FullScreenDlg {

    private String msg;

    public LoadingDlg setMsg(String msg) {
        this.msg = msg;
        if (binding != null) {
            binding.tv.setText(msg);
        }
        return this;
    }

    LoadingDlgBinding binding = null;

    @Override
    protected int getDlgTheme() {
        return R.style.TransDlg;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        binding = LoadingDlgBinding.inflate(inflater, container, false);
        //binding.loading.s
        if (!TextUtils.isEmpty(msg)) {
            binding.tv.setText(msg);
        } else {
            binding.tv.setText("");
        }
        return binding.getRoot();
    }
}

